package com.gollum.web.controller.permission;

import com.alibaba.fastjson2.JSONObject;
import com.gollum.common.domain.response.RestResponse;
import com.gollum.common.web.controller.BaseController;
import com.gollum.system.domain.request.SysRoleRequest;
import com.gollum.system.domain.request.SysUserRequest;
import com.gollum.system.service.SysRoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 角色管理
 *
 * @author Herther
 * @createTime 2022年11月13日 22:30:00
 * @since 1.0.0
 */
@Api(tags = "权限管理-角色管理")
@RestController
@RequestMapping("/role")
public class RoleController extends BaseController {

    @Autowired
    protected SysRoleService sysRoleService;

    @PostMapping("/list")
    @ApiOperation(value = "角色列表")
    public RestResponse listPage(@RequestBody JSONObject jsonObject) {
        //构建分页
        buildPageQuery(jsonObject);
        SysRoleRequest params = this.toJavaObjectParams(SysRoleRequest.class, jsonObject);
        return RestResponse.success(sysRoleService.listPage(params));
    }



}
